package com.example.demo.controller;

import com.example.demo.demo.User;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: 朱胜伟
 * @CreateTime: 2020-12-31 13:46
 * @Description:
 */
@RestController
public class swagger {
    @ApiOperation("这个方法是用来打招呼的")
    @GetMapping("/hello")
    public String hello(@ApiParam("这个参数需要一个username") String userName){
        return "hello "+userName;
    }
    @ApiOperation("这个也是")
    @PostMapping("/hi")
    public User hi(User hi){
        return hi;
    }
}
